package org.visionlibrary.image.filters.adjustement;

public class GammaCorrection {
	protected float gamma = 0.3f;

	public int[] getLut() {
		int[] lut = new int[256];
		for (int i = 0; i < 255; i++)
			lut[i] = (int) (255f * ((float) Math.pow(((float) i) / 255f,
					1.0f - gamma)));

		return lut;
	}

	public float getGamma() {
		return gamma;
	}

	public void setGamma(float gamma) {
		this.gamma = gamma;
	}
	
	@Override
	public String toString() {
		return new String("Adjustement>Gamma Correction");
	}
}
